package com.example.smart_city_0829.activity.waste_sorting;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.smart_city_0829.R;
import com.example.smart_city_0829.base.BaseActivity;
import com.example.smart_city_0829.entity.waste_sorting.Sort;
import com.example.smart_city_0829.retrofit.NetCallBack;
import com.example.smart_city_0829.utils.Constant;

import java.io.Serializable;
import java.util.List;

import retrofit2.Call;
import retrofit2.Response;

public class TypeIntroduceActivity extends BaseActivity {

    private ImageView im;
    private TextView introduce;
    private TextView deliveryRequirementsTv;

    private Sort.RowsBean data;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_type_introduce;
    }

    @Override
    protected void initView() {
        im = (ImageView) findViewById(R.id.im);
        introduce = (TextView) findViewById(R.id.introduce);
        deliveryRequirementsTv = (TextView) findViewById(R.id.delivery_requirements_tv);
    }

    @Override
    protected void initData() {
        final Serializable serializableData = getIntent().getSerializableExtra("data");
        data = ((List<Sort.RowsBean>) serializableData).get(0);

        Glide.with(context)
                .load(Constant.BASE_URL + data.getImgUrl())
                .into(im);

        introduce.setText(String.valueOf(data.getIntroduce()));
        deliveryRequirementsTv.setText(String.valueOf(data.getGuide()));
    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected String getActionBarTitle() {
        return "介绍页";
    }
}